package com.nts.visionworks.business.streamevent.domain;

import java.util.HashMap;
import java.util.Map;

/**
 * 시냅스 전달 매체의 타입을 나타내는 열거형을 정의한다.
 * @author Devcken
 */
public enum VariableType
{
	/**
	 * Short 타입
	 */
	Short((short)0),
	
	/**
	 * Integer 타입
	 */
	Integer((short)1),
	
	/**
	 * Long 타입
	 */
	Long((short)2),
	
	/**
	 * Float 타입
	 */
	Float((short)3),
	
	/**
	 * Double 타입
	 */
	Double((short)4),
	
	/**
	 * String 타입
	 */
	String((short)5),
	
	/**
	 * DateTime 타입
	 */
	DateTime((short)6);
	
	public final short value;
	
	private static final Map<Short, VariableType> _map = new HashMap<Short, VariableType>();
	
	static
	{
		for (VariableType item : VariableType.values())
		{
			_map.put(item.value, item);
		}
	}
	
	private VariableType(short value)
	{
		this.value = value;
	}

	public short value()
	{
		return this.value;
	}
	
	public static VariableType convert(short value)
	{
		return _map.get(value);
	}
}